/**
 * There are code generation
 */
package com.neusoft.lohas.modules.ivm.dao.workflow;

import org.springframework.stereotype.Repository;

import com.neusoft.lohas.common.persistence.BaseDao;
import com.neusoft.lohas.common.persistence.Parameter;
import com.neusoft.lohas.modules.ivm.entity.order.Order;
import com.neusoft.lohas.modules.ivm.entity.workflow.WorkFlow;

/**
 * 商品订单DAO接口
 * @author Jackie.Liu
 * @version 2014-12-21
 */
@Repository
public class WorkFlowDao extends BaseDao<WorkFlow> {

	public WorkFlow findByOrderId(String orderId) {
		return getByHql("from WorkFlow where order.id = :p1 and delFlag = :p2", new Parameter(orderId, Order.DEL_FLAG_NORMAL));
	}

	public int updateStatusById(String id, String status) {
		return update("update WorkFlow set status=:p1 where id = :p2", new Parameter(status, id));
	}
	
	public int deleteWorkFlowById(String id){
		return update("delete from WorkFlow where id = :p1", new Parameter(id));
	}
	
}
